function Model(viewer,option){
  this.viewer=viewer;
  this.option=option;
  this.entity;
  this.startPoint=option.position;
  this.endPoint=option.position;
  this.start = new Cesium.JulianDate();
  this.stop = new Cesium.JulianDate();
  this.viewer.clock.startTime = this.start.clone();
  this.viewer.clock.stopTime = this.stop.clone();
  this.viewer.clock.currentTime = this.start.clone();
  this.viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  this.viewer.clock.multiplier = 10;
  this.property = new Cesium.SampledPositionProperty();
  this.init();
}

Model.prototype.init=function(){
    let _this=this;
    this.getProperty(this.start,this.option.position);
    this.entity=this.viewer.entities.add({
        id: this.option.id,
        name: this.option.name || '未命名',
        type: this.option.type,
        code: this.option.code || '',
        availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
            start: _this.start,
            stop: _this.stop
        })]),
        position: this.property,
        orientation:new Cesium.VelocityOrientationProperty(this.property),
        model: {
            uri: this.option.url
        },
    });
    this.entity.position.setInterpolationOptions({
        interpolationDegree:5,
        interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
    });

    this.Interval();

}

Model.prototype.getProperty=function(start,startPoint) {
  this.property.addSample(start, Cesium.Cartesian3.fromDegrees(startPoint.x,  startPoint.y, startPoint.z));//开始点
}

Model.prototype.update=function() {
    this.property.addSample(this.start, Cesium.Cartesian3.fromDegrees(this.startPoint.x,  this.startPoint.y, this.startPoint.z));//开始点
    this.property.addSample(this.stop, Cesium.Cartesian3.fromDegrees(this.endPoint.x,  this.endPoint.y, this.endPoint.z));//开始点
/*     this.entity.position=this.property;
    this.entity.orientation=new Cesium.VelocityOrientationProperty(this.property);
    this.entity.position.setInterpolationOptions({
        interpolationDegree:5,
        interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
    }); */
/*    if(this.viewer.clock.shouldAnimate ==false){
        this.viewer.clock.shouldAnimate =true;
        console.log('sdfsdf');
    } */
}
Model.prototype.Interval=function() {
    let _this=this;
    setInterval(function(){
        _this.endPoint.x+=0.0001;
        _this.stop =  Cesium.JulianDate.fromDate(new Date());
        _this.viewer.clock.stopTime = _this.stop.clone();
        _this.update();
    },1000)

}

Model.prototype.destroy=function(){

}
